package com.iob.coin.entity;

import com.iob.coin.entity.questionTree.QuestionTree;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: GuoXinyuan
 * @Date: 2021/6/16
 * 缓存某一次查询中构建的补完树
 */
@Data
public class QuestionCache {

    final int cacheSize = 3;

    String oldestKey = "";

    Map<String,TreeCache> treeCacheMap = new HashMap<>();

    public void addTreeCache(QuestionTree questionTree,int mainAnswerSize,int additionAnswerSize){
        if(treeCacheMap.size() >= cacheSize){
//            treeCacheMap.keySet().forEach();
        }
    }

    private class TreeCache{

        String question; //对应问题

        QuestionTree tree; //缓存的树结构

        int mainAnswerSize;

        int additionAnswerSize;
    }



}
